package top.lingkang.privatespace.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import top.lingkang.privatespace.entity.Role;

import java.util.List;

/**
 * @author lingkang
 * Created by 2022/2/15
 */
public interface RoleMapper extends BaseMapper<Role> {

    @Select("select r.* from ps_user_role ur left join ps_role r on ur.role_id=r.id where ur.user_id=#{id}")
    List<Role> getRole(@Param("id") Integer userId);
}
